using Beaker.OpenCube.Render.Maths;

namespace Beaker.OpenCube.Render.Materials
{
	public abstract class TexelSource
		: ITexelSource
	{
		private readonly Size _size;

		protected TexelSource( int width, int height )
		{
			_size = new Size( width, height );
		}

		public Size Size
		{
			get { return _size; }
		}

		public virtual Color GetTexelColor( double u, double v )
		{
			return GetTexelColor( (int)u, (int)v );
		}

		public virtual Color GetTexelColor( Point2 texelCoordinates )
		{
			return GetTexelColor( (int)texelCoordinates.X, (int)texelCoordinates.Y );
		}

		protected abstract Color GetTexelColor( int u, int v );
	}
}